package com.yukefms.jointpoint;

import com.yukefms.jointpoint.interfaces.Position;
import third_party.ihmc.euclid.tuple3D.Vector3D;

import java.io.Serializable;

import java.util.Objects;

public class D3Position extends D2Position implements Position, Serializable {

    private double z ;

    public D3Position(double x, double y, double z) {
        super(x,y);
        this.z = z ;
    }

    @Override
    public double getZ() {
        return z;
    }
    @Override
    public void setZ(double z) {
        this.z = z;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof D3Position)) {
            return false;
        }
        if (!super.equals(o)) {
            return false;
        }
        D3Position that = (D3Position) o;
        return Double.compare(that.z, z) == 0;
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), z);
    }

    @Override
    public String toString() {
        return "Position{" +
                "x=" + x +
                ", y=" + y +
                ", z=" + z +
                '}';
    }
}
